using Assets.Scripts.GDK;

namespace Brick
{
	public class GameEndPanel : gdk_base_panel
	{
		public override void OnStart()
		{
			gdk_game_manager.PlaySound(AudioID.failed);
			GDK.ModuleManger.Module<LevelInfoBoxModule>().sendFailCustomEvent();
		}

		public void OnLobbyClick()
		{
			gdk_game_manager.PlaySound(AudioID.click);
			string adType = GameManager.getAdType();
			GDK.ModuleManger.Module<AdvansBoxMoudle>().PlayAD(Advans.XPSBBACK, adType, delegate
			{
				//SDKManager.Instance.HidenBanner();
				gdk_game_manager.blackScene();
				close();
			}, delegate
			{
				//SDKManager.Instance.HidenBanner();
				gdk_game_manager.blackScene();
				close();
			});
		}

		public void OnRestartClick()
		{
			gdk_game_manager.PlaySound(AudioID.click);
			string adType = GameManager.getAdType();
			GDK.ModuleManger.Module<AdvansBoxMoudle>().PlayAD(Advans.XPSBREPLAY, adType, delegate
			{
				GDK.ModuleManger.Module<LevelInfoBoxModule>().sendCustomEvent();
				gdk_game_manager.DispachEvent(EventID.HIDE_PLAY_DANGER);
				gdk_game_manager.showPanel(PanelID.YULAN);
				close();
			}, delegate
			{
				//SDKManager.Instance.HidenBanner();
				gdk_game_manager.blackScene();
				close();
			});
		}
	}
}

